<template>
  <div class="item-box">
    <img class="avatar" :src="item.avatar" alt="" />
    <div>
      <div>
        <p class="item-titile">{{ item.author }}</p>
      </div>
      <p class="item-content">{{ item.content }}</p>
      <div>
        <p class="item-time">
          {{ fmtDate(item.time * 1000, "MM-DD hh:mm") }}
        </p>
      </div>
    </div>
  </div>
</template>

<script>
import { fmtDate } from "@/utils/filters";
export default {
  props: {
    item: {
      type: Object,
      default: {},
    },
  },
  setup() {
    return { fmtDate };
  },
};
</script>

<style lang="scss" scoped>
.item-box {
  border-bottom: 1px solid rgba(245, 245, 245, 1);
  padding: 0.1rem;
  display: flex;
  .avatar {
    width: 0.3rem;
    height: 0.3rem;
    border-radius: 50%;
    margin-right: 0.1rem;
  }
  .item-titile {
    font-weight: 700;
    font-size: 0.16rem;
    line-height: 0.26rem;
  }
  .item-content {
    font-size: 0.14rem;
    line-height: 0.24rem;
  }
  .item-time {
    font-size: 0.14rem;
    color: #ccc;
    margin-top: 0.05rem;
  }
}
</style>